<template>
  <div class="add-condition-tem">
    <el-dialog :close-on-click-modal="false" modal-append-to-body lock-scroll top="10%" :visible.sync="addCondTemData.isShow" :title="$t('qualityCheck.extractConditionTemplate')" style="min-width:800px;" @close="addCondTemDataClose">
      <div class="line">
        <span>{{$t('qualityCheck.templateName')}}</span><el-input class="temp-name" size="mini" v-model.trim="Form.tempName" :maxlength=10 :placeholder="$t('qualityCheck.theMostChart')"></el-input>
      </div>
      <div class="line" style="margin-bottom:10px;">
        <span>{{$t('qualityCheck.extractRules')}}</span>
        <el-radio-group v-model="selectRule" @change="changeChouQuRadio">
          <div class="chouqu-guize">
            <el-radio name="selectRule" label="1" size="mini">{{$t('qualityCheck.numArticles')}}</el-radio>
            <el-select style="width:100px;" size="mini" v-model.trim="Form.sampleNum" :disabled="chouquState !== '1'">
              <el-option :label="$t('qualityCheck.numPerCapita')" value="per_num"></el-option>
              <el-option :label="$t('qualityCheck.wholeNumArticles')" value="entirety_num"></el-option>
            </el-select>
            <el-input size="mini" style="width:60px;" :maxlength=4 v-model="Form.count" @blur="justNum" :disabled="chouquState !== '1'"></el-input>
          </div>
          <br>
          <div class="chouqu-guize">
            <el-radio name="selectRule" label="2" size="mini">{{$t('qualityCheck.percentage')}}</el-radio>
            <el-select style="width:100px;" size="mini" v-model.trim="Form.samplePercent" :disabled="chouquState === '1'">
              <el-option :label="$t('qualityCheck.perCapitaPercentage')" value="per_percent"></el-option>
              <el-option :label="$t('qualityCheck.wholeCapitaPercentage')" value="entirety_percent"></el-option>
            </el-select>
            <div style="display: inline-block;">
              <el-input
                :disabled="chouquState === '1'"
                size="mini"
                style="width:100px;"
                v-model="Form.percent"
                :maxlength=3
                @blur="justNum"
              >
                <template slot="append">%</template>
              </el-input>
            </div>
          </div>
        </el-radio-group>
      </div>
      <!--通话==========================-->
      <div class="call" v-if="addCondTemData.curQualilyType !== 'qualityWebchat'">
        <div class="line">
          <span>{{$t('public.callTime')}}</span>
          <el-date-picker size="mini"
                          style="margin-left: 10px;"
                          :id="['d1','d2']"
                          v-model.trim="callForm.callTime"
                          type="datetimerange"
                          :picker-options="pickerOptions2"
                          :placeholder="$t('public.timeRanges')"
                          :editable="false"
                          align="right">
          </el-date-picker>
        </div>
        <div class="line">
          <span>{{$t('call.callType')}}</span>
          <el-select v-model="callForm.CONNECT_TYPE" multiple :placeholder="$t('public.pleasePick')" size="mini">
            <el-option
              v-for="(item, index) in callTypeList"
              :label="item.code_name"
              :key="index"
              :value="item.code_value">
            </el-option>
          </el-select>
        </div>
        <div class="line">
          <span>{{$t('public.queues')}}</span>
          <el-select size="mini" v-model="callForm.QUEUE" multiple :placeholder="$t('public.pleasePick')">
            <el-option
              v-for="(item, index) in callQueueList"
              :label="item.DisplayName"
              :key="index"
              :value="item.Exten">
            </el-option>
          </el-select>
        </div>
        <div class="line" v-show="callAgentShow">
          <span>{{$t('qualityCheck.callAgent')}}</span>
          <!-- <el-select v-model="callForm.QA_SPECIALIST" multiple :placeholder="$t('public.pleasePick')" size="mini">
            <el-option
              v-for="(item, index) in callAgentList"
              :key="index"
              :label="item.displayName + '[' + item.exten + ']'"
              :value="item._id">
            </el-option>
          </el-select> -->
          <m7Select class="el-select" multiple filterable :options="selectAgents" v-model="callForm.QA_SPECIALIST"></m7Select>
          <el-checkbox style="margin-left: 10px;" v-model="callForm.includeSubordinate" :label="$t('public.includeUnderAgent')" name="type"></el-checkbox>
        </div>
        <div class="line">
          <span>{{$t('call.callTime')}}</span>
          <el-input
            style="width:100px;"
            size="mini"
            placeholder=""
            @blur="justNum"
            v-model="callForm.CALL_TIME_LENGTH_BEGIN">
            <template slot="append">{{$t('public.seconds')}}</template>
          </el-input>
          <span style="margin-left: 18px;padding-top:10px;display: inline-block;width:20px;">{{$t('public.to')}}</span>
          <el-input
            style="width:100px;"
            size="mini"
            placeholder=""
            @blur="justNum"
            v-model="callForm.CALL_TIME_LENGTH_END">
            <template slot="append">{{$t('public.seconds')}}</template>
          </el-input>
        </div>
        <div class="line">
          <span>{{$t('softPhoneBar.getInvestigate')}} </span>
          <el-select size="mini" v-model.trim="callForm.INVESTIGATE" filterable :placeholder="$t('webchat.webchatAll')">
            <el-option value="" :label="'--'+$t('webchat.webchatAll')+'--'"></el-option>
            <el-option :label="'--'+$t('public.unevaluated')+'--'" value="unevaluated"></el-option>
            <el-option
              v-for="(item, index) in satisfactionList"
              :key="index"
              :label="item.name"
              :value="item.value">
            </el-option>
          </el-select>
        </div>
        <div class="line">
          <span>{{$t('public.callLabel')}}</span>
          <div class="call-lable">
            <label-cascader @labelSelect="labelSelect" :resetSelect="resetSelect" :needType="true"></label-cascader>
          </div>
        </div>
      </div>
      <!--在线咨询========================================-->
      <div class="webChat" v-if="addCondTemData.curQualilyType === 'qualityWebchat'">
        <div class="line">
          <span>{{$t('webchat.takeTime')}}</span>
          <el-date-picker size="mini"
                          style="margin-left:10px;"
                          :id="['d3','d4']"
                          v-model.trim="webForm.lingquTime"
                          type="datetimerange"
                          :picker-options="pickerOptions2"
                          :placeholder="$t('public.timeRanges')"
                          :editable="false"
                          align="right">
          </el-date-picker>
        </div>
        <div class="line">
          <span>{{$t('qualityCheck.agentForQua')}}</span>
          <!-- <el-select v-model="webForm.selectedAgentList" multiple :placeholder="$t('public.pleasePick')" size="mini">
            <el-option
              v-for="(item, index) in callAgentList"
              :key="index"
              :label="item.displayName + '[' + item.exten + ']'"
              :value="item._id">
            </el-option>
          </el-select> -->
          <m7Select class="el-select" multiple filterable :options="selectAgents" v-model="webForm.selectedAgentList"></m7Select>
          <el-checkbox style="margin-left:10px;"  v-model="webForm.includeSubordinate" :label="$t('public.includeUnderAgent')" name="type"></el-checkbox>
        </div>
        <div class="line">
          <span>{{$t('softPhoneBar.getInvestigate')}}</span>
          <el-select size="mini" v-model.trim="webForm.appraiseKey" filterable :placeholder="$t('public.all')">
            <el-option :label="'--'+$t('webchat.webchatAll')+'--'" value=""></el-option>
            <el-option :label="'--'+$t('public.unevaluated')+'--'" value="unevaluated"></el-option>
            <el-option
              v-for="(item, index) in appraiseList"
              :key="index"
              :label="item.name"
              :value="item.key"
            >
            </el-option>
          </el-select>
        </div>
        <div class="line">
          <span>{{$t('webchat.msgNum')}}</span>
          <el-radio-group style="margin-left: 10px;" v-model.trim="webForm.msgCountType">
            <el-radio size="mini" label="gt" >{{$t('webchat.moreThan')}}</el-radio>
            <el-radio size="mini" label="lt" >{{$t('webchat.lessThan')}}</el-radio>
            <el-radio size="mini" label="eq" >{{$t('webchat.equal')}}</el-radio>
          </el-radio-group>
          <el-input style="width:100px;" size="mini" v-model.trim="webForm.msgCount" @blur="justNum" :placeholder="$t('public.pleaseEnter')"></el-input>
        </div>
        <div class="line">
          <span style="width: 80px;">{{$t('qualityCheck.endTheSessionType')}}</span>
          <el-cascader
            popper-class="webchat-finish"
            style="margin: 0px 10px"
            :placeholder="$t('webchat.chooseEndSessionType')"
            :options="closeOptions"
            filterable
            @change="autoChangeFun"
            v-model="activeAutoClose">
          </el-cascader>
        </div>
        <div class="line">
          <span style="width: 80px;">{{$t('webchat.platformSource')}}</span>
          <el-select size="mini" v-model.trim="webForm.platform" :placeholder="$t('public.all')">
            <el-option :label="'--'+$t('webchat.webchatAll')+'--'" value=""></el-option>
            <el-option
              v-for="(item, index) in platforms"
              :label="item.label"
              :value="item.value"
              :key="index"
            >
            </el-option>
          </el-select>
        </div>
      </div>
      <!--保存  抽取======================-->
      <div slot="footer" class="dialog-footer btn-wrap">
        <el-button class="primary_btn report_excel_btn" @click="resetForm">{{$t('public.reset')}}</el-button>
        <el-button class="primary_btn" type="primary" @click="justSaveTheTemp">{{$t('qualityCheck.onlySave')}}</el-button>
        <el-button class="primary_btn" type="primary" @click="searchAndSaveTheTemp">{{$t('qualityCheck.saveAndExtract')}}</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import LabelCascader from '@/components/public-modules/phone-bar/LabelCascader.vue'
  import {deepClone, getDateTime, m7Language, updateOptions, isHasFunc} from '@/utils/m7Utils'
  import * as globalTypes from '@/store/mutation-types'
  export default {
    name: 'addConditionTem',
    data () {
      return {
        pickerOptions2: {
          shortcuts: [{
            text: this.$t('sms.thisOneWeek'),
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: this.$t('sms.thisOneMonth'),
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
              picker.$emit('pick', [start, end])
            }
          }, {
            text: this.$t('sms.thisThreeMonth'),
            onClick (picker) {
              const end = new Date()
              const start = new Date()
              start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
              picker.$emit('pick', [start, end])
            }
          }]
        },
        chouquState: '1',
        selectRule: '1',
        labelType: 'single',
        addTempState: 'addAndSelect',        //   仅保存  保存并抽取  状态
        callTypeList: [],                   // 呼叫类型
        callQueueList: [],                  // 技能组
        callAgentList: [],                  // 质检专员
        satisfactionList: [],               // 满意度
        resetSelect: false,                 //  录音内容分类
        callAgentShow: false,            // 是否显示座席信息
        closeOptions: [],
        finishReasonList: [],               //   结束类型
        endSessionOptions: [],
        activeAutoClose: [],
        appraiseList: [],                  //    在线 满意度
        qualityConditionTemplates: [],     //   条件模板
        Form: {
          tempName: '',
          sampleNum: 'per_num',
          count: '10',
          samplePercent: 'per_percent',
          percent: '10'
        },
        platforms: [
          {label: this.$t('webchat.websiteCon'), value: 'pc'},
          {label: this.$t('webchat.wapCon'), value: 'wap'},
          {label: this.$t('webchat.appCon'), value: 'sdk'},
          {label: this.$t('webchat.weChatCon'), value: 'weixin'},
          {label: this.$t('webchat.weChatMini'), value: 'wxmini'},
          {label: this.$t('webchat.weBoCon'), value: 'weibo'},
          {label: this.$t('webchat.enterpriseShot'), value: 'wxwork'},
          {label: this.$t('webchat.baiduBCP'), value: 'ocpc'},
          {label: this.$t('webchat.TikTok'), value: 'dy'},
          {label: this.$t('webchat.platformWXKF'), value: 'wxkf'}
        ],
        callForm: {
          callTime: '',
          CONNECT_TYPE: [],
          QUEUE: [],
          QA_SPECIALIST: [],
          includeSubordinate: false,
          INVESTIGATE: '',
          CALL_TIME_LENGTH_BEGIN: '',
          CALL_TIME_LENGTH_END: '',
          multiLabel: []
        },
        webForm: {
          lingquTime: '',
          selectedAgentList: [],
          includeSubordinate: false,
          msgCountType: '',
          msgCount: '',
          finishKey: '',
          appraiseKey: '',
          platform: ''
        }
      }
    },
    props: {
      addCondTemData: {
        type: Object,
        default: function () {
          return {
            isShow: false
          }
        }
      }
    },
    components: {
      LabelCascader
    },
    computed: {
      selectAgents () {
        if (this.$store.getters.userHidden === 'yes') {
          let agentList = this.$store.getters.filterStopAgents && this.$store.getters.filterStopAgents.map(agent => ({ label: `${agent.displayName}[${agent.exten}]`, value: agent._id }))
          return agentList
        }
        return this.callAgentList
      }
    },
    methods: {
//        抽取规则  条数 百分比 切换
      changeChouQuRadio (value) {
        this.chouquState = value
      },
      justNum () {
        if (this.selectRule === '1') {
          this.Form.count = this.Form.count.replace(/\D/gi, '')
        } else {
          this.Form.percent = this.Form.percent.replace(/\D/gi, '')
        }
        this.callForm.CALL_TIME_LENGTH_BEGIN = this.callForm.CALL_TIME_LENGTH_BEGIN.replace(/\D/gi, '')
        this.callForm.CALL_TIME_LENGTH_END = this.callForm.CALL_TIME_LENGTH_END.replace(/\D/gi, '')
        this.webForm.msgCount = this.webForm.msgCount.replace(/\D/gi, '')
      },
//      录音内容分类
      labelSelect (data) { // 子组件外抛出来的表单
        this.resetSelect = false
        if (data.type === 'single') {
          this.labelType = 'single'
          delete this.callForm.multiLabel
          this.callForm.singleLabel = data.arr[0] || ''
        } else {
          this.labelType = 'multi'
          this.callForm.multiLabel = data.arr && data.arr[0] ? data.arr : []
          delete this.callForm.singleLabel
        }
      },
      autoChangeFun (data) {
        if (data) {
          let option = this.activeAutoClose[this.activeAutoClose.length - 1]
          if (option || option !== '') {
            let actName = option.split('__')[1]
            let finishKey = option.split('__')[0]
            this.webForm.finishKey = finishKey
          }
        } else {
          this.webForm.finishKey = ''
        }
      },
//      仅保存
      justSaveTheTemp () {
        this.addTempState = 'add'
        this.SaveTheTemp()
      },
//      保存并抽取
      searchAndSaveTheTemp () {
        this.addTempState = 'addAndSelect'
        this.SaveTheTemp()
      },
//      保存并抽取
//      保存
      SaveTheTemp () {
        let data = {}
        data.TEMPLATE_NAME = this.Form.tempName
//          抽取规则
        if (this.selectRule === '1') {
          data.EXT_RULE = 'COUNT_TYPE_NUM'
        } else {
          data.EXT_RULE = 'COUNT_TYPE_PERCENT'
        }
        data.COUNT_TYPE_PERCENT = this.Form.samplePercent
        data.COUNT_TYPE_NUM = this.Form.sampleNum
        data.RANDOMNUM = this.Form.count
        data.PERCENT = this.Form.percent
        data.QUALITY_TYPE = this.addCondTemData.curQualilyType
//        ===================
        if (!data.TEMPLATE_NAME || data.TEMPLATE_NAME === '') {
          this.$message.error(this.$t('qualityCheck.fillTemplateName'))
          return
        }
        if (!data.EXT_RULE || data.EXT_RULE === '') {
          data.EXT_RULE = 'COUNT_TYPE_NUM'
        }
        if (data.EXT_RULE === 'COUNT_TYPE_NUM') {
          if (!data.RANDOMNUM || data.RANDOMNUM === '') {
            this.$message.error(this.$t('qualityCheck.randomlyqualityRecords'))
            return
          }
          if (Number(data.RANDOMNUM) > 1000) {
            this.$message.error(this.$t('qualityCheck.theMostRandomNum'))
            return
          }
          if (Number(data.RANDOMNUM) < 1) {
            this.$message.error(this.$t('qualityCheck.theMinRandomNum'))
            return
          }
        } else if (data.EXT_RULE === 'COUNT_TYPE_PERCENT') {
          if (!data.PERCENT || data.PERCENT === '') {
            this.$message.error(this.$t('qualityCheck.randomlyqualityRecordspercentage'))
            return
          }
          if (Number(data.PERCENT) > 100 || Number(data.PERCENT) < 1) {
            this.$message.error(this.$t('qualityCheck.percentageRange'))
            return
          }
        }
//        ======================
        if (this.addCondTemData.curQualilyType !== 'qualityWebchat') {  //  通话
//          呼叫时间
          if (this.callForm.callTime.length && this.callForm.callTime[0] !== null) {
            data.BEGIN_TIME = getDateTime(this.callForm.callTime[0])
          }
          if (this.callForm.callTime.length && this.callForm.callTime[1] !== null) {
            data.END_TIME = getDateTime(this.callForm.callTime[1])
          }
//          呼叫类型
          if (this.callForm.CONNECT_TYPE.length) {
            data.CONNECT_TYPE_SELECTED = this.callForm.CONNECT_TYPE.join(',')
          } else {
            data.CONNECT_TYPE_SELECTED = ''
          }
//          技能组
          if (this.callForm.QUEUE.length) {
            data.ERROR_MEMO_SELECTED = this.callForm.QUEUE.join(',')
          } else {
            data.ERROR_MEMO_SELECTED = ''
          }
//          通话时长
          data.CALL_TIME_LENGTH_BEGIN = this.callForm.CALL_TIME_LENGTH_BEGIN
          data.CALL_TIME_LENGTH_END = this.callForm.CALL_TIME_LENGTH_END
//          满意度
          data.INVESTIGATE = this.callForm.INVESTIGATE
//          录音内容分类
          if (this.labelType === 'single') {
            data.singleLabel = this.callForm.singleLabel
          } else {
            data.multiLabel = this.callForm.multiLabel
          }
          if (this.callForm.QA_SPECIALIST.length) {
            data.selectedAgentList = this.callForm.QA_SPECIALIST.join(',')
          } else {
            data.selectedAgentList = ''
          }
          data.includeSubordinate = this.callForm.includeSubordinate
          if (this.addTempState === 'add') {
            this.$store.dispatch('addQualityCheckRandomTemplates', data).then(res => {
              if (res.success) {
                if (res.condition && this.qualityConditionTemplates.indexOf(res.condition) === -1) {
                  this.$store.commit(globalTypes.PUSH_CONDITION_TEM, res.condition)
                }
                this.$emit('addConditionTem', this.addTempState)
              } else {
                if (res.code === 0) {
                  this.$message.error(res.message)
                  return
                }
              }
            })
          }
          if (this.addTempState === 'addAndSelect') {
            data.pageSize = 10
            data.page = 1
            data.cdrId = 'quality_check_query_random_template_addAndSelect'
            this.$store.dispatch('normalCallSearch', data).then(res => {
              if (res.success) {
                if (res.countAll === 0) {
                  this.$message.error(this.$t('qualityCheck.noEligibleCallRecords'))
                  return
                }
                this.$emit('addConditionTem', this.addTempState)
              } else {
                if (res.code === 0) {
                  this.$message.error(res.message)
                  return
                }
                this.$message.error(this.$t('qualityCheck.searchError'))
                return
              }
            })
          }
        } else {   //   在线咨询
          data.flag = this.addTempState
          if (data.flag === 'addAndSelect') {
            data.page = 1
            data.pageSize = 10
          }
//          所选座席
          if (this.webForm.selectedAgentList.length) {
            data.selectedAgentList = this.webForm.selectedAgentList.join(',')
          } else {
            data.selectedAgentList = ''
          }
          data.includeSubordinate = this.webForm.includeSubordinate
//          结束会话类型
          data.finishKey = this.webForm.finishKey
          data.platform = this.webForm.platform
//          消息条数
          data.msgCount = this.webForm.msgCount
//          消息类型
          data.msgCountType = this.webForm.msgCountType
//          领取时间
          if (this.webForm.lingquTime.length && this.webForm.lingquTime[0] !== null) {
            data.beginTimeBegin = getDateTime(this.webForm.lingquTime[0])
          }
          if (this.webForm.lingquTime.length && this.webForm.lingquTime[1] !== null) {
            data.beginTimeEnd = getDateTime(this.webForm.lingquTime[1])
          }
          data.appraiseKey = this.webForm.appraiseKey
          this.$store.dispatch('addOrSelectRandomTemplate', data).then(res => {
            if (!res.success) {
              if (res.code !== 0) {
                this.$message.error(this.$t('qualityCheck.saveFali'))
                return
              }
              return
            }
            if (res.success) {
              if (res.condition && this.qualityConditionTemplates.indexOf(res.condition) === -1) {
                this.$store.commit(globalTypes.PUSH_CONDITION_TEM, res.condition)
              }
              if (this.addTempState === 'addAndSelect') {
                if (res.count === 0) {
                  this.$message.error(this.$t('qualityCheck.noWebHistory'))
                  return
                }
                this.$emit('addConditionTem', this.addTempState)
              }
              if (this.addTempState === 'add') {
                this.$emit('addConditionTem', this.addTempState)
              }
            }
          })
        }
      },
//      重置
      resetForm () {
        this.Form.tempName = ''
        this.Form.sampleNum = 'per_num'
        this.Form.count = '10'
        this.Form.samplePercent = 'per_percent'
        this.Form.percent = '10'
        for (let i in this.callForm) {
          if (typeof this.callForm[i] === 'string') {
            this.callForm[i] = ''
          } else {
            this.callForm[i] = []
          }
        }
        for (let i in this.webForm) {
          if (typeof this.webForm[i] === 'string') {
            this.webForm[i] = ''
          } else {
            this.webForm[i] = []
          }
        }
        this.selectRule = '1'
        this.callForm.includeSubordinate = false
        this.webForm.includeSubordinate = false
        this.resetSelect = true
        this.activeAutoClose = ''
      },
//      dialog  关闭
      addCondTemDataClose () {
        this.resetForm()
      }
    },
    beforeMount () {
      let p1 = this.$store.dispatch('getCache', {type: 'callType'})
      let p2 = this.$store.dispatch('getCache', {type: 'queues'})
      let p3 = this.$store.dispatch('getCache', {type: 'agents'})
      let p4 = this.$store.dispatch('getCache', {type: 'options'})
      let p5 = this.$store.dispatch('getCache', {type: 'channelDic'})
      let p6 = this.$store.dispatch('getCache', {type: 'qualityConditionTemplates'})
      Promise.all([p1, p2, p3, p4, p5, p6]).then(() => {
        this.qualityConditionTemplates = this.$getCache('qualityConditionTemplates')
        let callTypeList = deepClone(this.$getCache('callType'))
        callTypeList = callTypeList.filter(item => {
          item.code_name = m7Language('globalChineseKey.' + item.code_name, null, true) || item.code_name
          return item
        })
        this.callTypeList = callTypeList
        this.callQueueList = this.$getCache('queues')
        this.$getCache('agents').map(agent => {
          this.callAgentList.push({ label: `${agent.displayName}[${agent.exten}]`, value: agent._id })
        })
//        通话 满意度 start =================
        let _dics = []
        let optionsRes = this.$getCache('options')
        for (let i = 0; i < optionsRes.length; i++) {
          let obj = optionsRes[i]
          if (obj.name === '满意度调查选项') {
            _dics = obj.options || []
            break
          }
        }
        let satisfactionList = []
        for (let n = 0; n < _dics.length; n++) {
          if (_dics[n].name && _dics[n].options[0].name) {
            satisfactionList.push({name: _dics[n].name, value: _dics[n].options[0].name})
          }
        }
        this.satisfactionList = satisfactionList
        console.log(JSON.stringify(this.satisfactionList))
//        通话 满意度 end =================
//        结束类型 ===============
        let finishDics = []
        let dics = this.$getCache('channelDic')
        for (let i = 0; i < dics.length; i++) {
          let obj = dics[i]
          if (obj.type === 'webchat') {
            finishDics = obj.options || []
            break
          }
        }
        let finishKeys = []
        updateOptions(finishDics, {Arr: this.endSessionOptions})
        this.closeOptions = this.endSessionOptions
        this.activeAutoClose = ''
//        在线  满意度
        for (let i = 0; i < dics.length; i++) {
          let obj = dics[i]
          if (obj.type === 'webchatCSR') {
            this.appraiseList = obj.options || []
            break
          }
        }
        console.log(JSON.stringify(this.appraiseList))
      })
      if (isHasFunc('func_call_quality_agent', this.$store.state.session.user)) {
        this.callAgentShow = true
      }
    }
  }
</script>
<style lang="stylus" scoped>
  @import "../../../../assets/common.styl"
  .add-condition-tem
    .el-dialog--small
      min-width 800px
    .line
      margin-bottom 16px
      span
        display inline-block
        vertical-align middle
        width 80px
      .call-lable
        display inline-block
        margin-left 10px
        span
          width 450px
    .el-input
    .el-select
      margin-left 10px
      width 200px
    .temp-name
      width 140px
    .chouqu-guize
      margin-left 10px
      margin-bottom 10px
</style>
